package com.easybuy.dao;

import java.util.List;

import com.easybuy.entity.Product;

public interface ProductDao {

	/**
	 * 
	 * @param categoryId
	 * @param categoryLevel
	 * @param startIndex  起始索引
	 * @param pageSize  页面大小
	 * @return
	 */
	List<Product> findByCategoryId(int categoryId,int categoryLevel,int startIndex,int pageSize);
	
	/**
	 * 查记录数
	 * @param categoryId
	 * @param categoryLevel
	 * @return
	 */
	int findCountByCategoryId(int categoryId,int categoryLevel);

	Product findById(int id);
	
	int subStock(int productId,int quantity);

	List<Product> findList(int startIndex, int pageSize);

	int findCount();
}
